﻿<?php
    include('checkAdminAccess.php');
    $iniVars = parse_ini_file('../../config.ini',TRUE);
    include('../classes/adodb5/adodb.inc.php');
    include('../function/db.func.php');
    
    $action = $_POST['action'];
    
    if($action=='topMsg'){
        $msgTh = $_POST['msgTh'];
        $msgEn = $_POST['msgEn'];
        $msgJp = $_POST['msgJp'];
        $msgCh = $_POST['msgCh'];
        
        $sql = 'UPDATE text_data SET td_value="'.$msgTh.'" WHERE td_id=10';
        $result = $db->Execute($sql);
        $sql = 'UPDATE text_data SET td_value="'.$msgEn.'" WHERE td_id=11';
        $result = $db->Execute($sql);
        $sql = 'UPDATE text_data SET td_value="'.$msgJp.'" WHERE td_id=12';
        $result = $db->Execute($sql);
        $sql = 'UPDATE text_data SET td_value="'.$msgCh.'" WHERE td_id=13';
        $result = $db->Execute($sql);
        if($result)
        {
            echo "success";
        }
        else
        {
            echo "fail";
        }
    }else if($action=='imgDesc'){
        $imgDescTh = $_POST['imgDescTh'];
        $imgDescEn = $_POST['imgDescEn'];
        $imgDescJp = $_POST['imgDescJp'];
        $imgDescCh = $_POST['imgDescCh'];
        
        $sql = 'UPDATE text_data SET td_value="'.$imgDescTh.'" WHERE td_id=16';
        $result = $db->Execute($sql);
        $sql = 'UPDATE text_data SET td_value="'.$imgDescEn.'" WHERE td_id=17';
        $result = $db->Execute($sql);
        $sql = 'UPDATE text_data SET td_value="'.$imgDescJp.'" WHERE td_id=18';
        $result = $db->Execute($sql);
        $sql = 'UPDATE text_data SET td_value="'.$imgDescCh.'" WHERE td_id=19';
        $result = $db->Execute($sql);
        if($result)
        {
            echo "success";
        }
        else
        {
            echo "fail";
        }
    }
?>